home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 002 / emacssrc.arc / EXEC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-02-10  |  17.0 KB  |  901 lines

  1. /*    This file is for functions dealing with execution of
  2.     commands, command lines, buffers, files and startup files
  3.  
  4.     written 1986 by Daniel Lawrence                */
  5.  
  6. #include    <stdio.h>
  7. #include    "estruct.h"
  8. #include    "edef.h"
  9.  
  10. #if    MEGAMAX & ST520
  11. overlay    "exec"
  12. #endif
  13.  
  14. #if    DEBUGM
  15. char outline[NSTRING];        /* global string to hold debug line text */
  16. #endif
  17.  
  18. /* namedcmd:    execute a named command even if it is not bound */
  19.  
  20. namedcmd(f, n)
  21.  
  22. int f, n;    /* command arguments [passed through to command executed] */
  23.  
  24. {
  25.     register (*kfunc)();    /* ptr to the requexted function to bind to */
  26.     int (*getname())();
  27.  
  28.     /* prompt the user to type a named command */
  29.     mlwrite(": ");
  30.  
  31.     /* and now get the function name to execute */
  32.     kfunc = getname();
  33.     if (kfunc == NULL) {
  34.         mlwrite("[No such function]");
  35.         return(FALSE);
  36.     }
  37.  
  38.     /* and then execute the command */
  39.     return((*kfunc)(f, n));
  40. }
  41.  
  42. /*    execcmd:    Execute a command line command to be typed in
  43.             by the user                    */
  44.  
  45. execcmd(f, n)
  46.  
  47. int f, n;    /* default Flag and Numeric argument */
  48.  
  49. {
  50.     register int status;        /* status return */
  51.     char cmdstr[NSTRING];        /* string holding command to execute */
  52.  
  53.     /* get the line wanted */
  54.     if ((status = mlreply(": ", cmdstr, NSTRING)) != TRUE)
  55.         return(status);
  56.  
  57.     execlevel = 0;
  58.     return(docmd(cmdstr));
  59. }
  60.  
  61. /*    docmd:    take a passed string as a command line and translate
  62.         it to be executed as a command. This function will be
  63.         used by execute-command-line and by all source and
  64.         startup files. Lastflag/thisflag is also updated.
  65.  
  66.     format of the command line is:
  67.  
  68.         {# arg} <command-name> {<argument string(s)>}
  69.  
  70.     Directives start with a "!" and include:
  71.  
  72.     !endm        End a macro
  73.     !if (cond)    conditional execution
  74.     !else
  75.     !endif
  76.     !return        Return (terminating current macro)
  77.     !goto <label>    Jump to a label in the current macro
  78.  
  79.     Line Labels begin with a "*" in column 1, like:
  80.  
  81.     *LBL01
  82. */
  83.  
  84. docmd(cline)
  85.  
  86. char *cline;    /* command line to execute */
  87.  
  88. {
  89.     register int f;        /* default argument flag */
  90.     register int n;        /* numeric repeat value */
  91.     register int i;
  92.     int (*fnc)();        /* function to execute */
  93.     int status;        /* return status of function */
  94.     int oldcle;        /* old contents of clexec flag */
  95.     int llen;        /* length of cline */
  96.     int force;        /* force TRUE result? */
  97.     char *tmp;        /* tmp pointer into cline */
  98.     struct LINE *lp;    /* a line pointer */
  99.     char *oldestr;        /* original exec string */
  100.     char token[NSTRING];    /* next token off of command line */
  101.     int (*fncmatch())();
  102. #if    DEBUGM
  103.     /* if $debug == TRUE, every line to execute
  104.        gets echoed and a key needs to be pressed to continue
  105.        ^G will abort the command */
  106.     register char *sp;    /* pointer into buf to expand %s */
  107.  
  108.     if (macbug) {
  109.         strcpy(outline, "<<<");
  110. #if    1    /* debug if levels */
  111.         strcat(outline, itoa(execlevel));
  112.         strcat(outline, ":");
  113. #endif
  114.         strcat(outline, cline);
  115.         strcat(outline, ">>>");
  116.  
  117.         /* change all '%' to ':' so mlwrite won't expect arguments */
  118.         sp = outline;
  119.         while (*sp) {
  120.             if (*sp++ == '%')
  121.                 *(sp-1) = ':';
  122.         }
  123.  
  124.         /* write out the debug line */
  125.         mlwrite(outline);
  126.         update(TRUE);
  127.  
  128.         /* and get the keystroke */
  129.         if (tgetc() == 7) {
  130.             mlwrite("[Macro aborted]");
  131.             return(FALSE);
  132.         }
  133.     }
  134. #endif
  135.         
  136.     /* dump comments here */
  137.     if (*cline == ';')
  138.         return(TRUE);
  139.  
  140.     /* eat leading spaces */
  141.     while (*cline == ' ' || *cline == '\t')
  142.         ++cline;
  143.  
  144.     /* check to see if this line turns macro storage off */
  145.     if (cline[0] == '!' && strncmp(&cline[1], "endm", 4) == 0) {
  146.         mstore = FALSE;
  147.         bstore = NULL;
  148.         return(TRUE);
  149.     }
  150.  
  151.     /* if macro store is on, just salt this away */
  152.     if (mstore) {
  153.         /* allocate the space for the line */
  154.         llen = strlen(cline);
  155.         if ((lp=lalloc(llen)) == NULL) {
  156.             mlwrite("Out of memory while storing macro");
  157.             return (FALSE);
  158.         }
  159.  
  160.         /* copy the text into the new line */
  161.         for (i=0; i<llen; ++i)
  162.             lputc(lp, i, cline[i]);
  163.  
  164.         /* attach the line to the end of the buffer */
  165.                bstore->b_linep->l_bp->l_fp = lp;
  166.         lp->l_bp = bstore->b_linep->l_bp;
  167.         bstore->b_linep->l_bp = lp;
  168.         lp->l_fp = bstore->b_linep;
  169.         return (TRUE);
  170.     }
  171.     
  172.     /* dump labels here */
  173.     if (*cline == '*')
  174.         return(TRUE);
  175.  
  176.     force = FALSE;
  177.     oldestr = execstr;    /* save last ptr to string to execute */
  178.     execstr = cline;    /* and set this one as current */
  179.  
  180.     /* process directives */
  181.     if (*cline == '!') {
  182.         /* save directive location and skip it */
  183.         tmp = cline;
  184.         while (*execstr && *execstr != ' ' && *execstr != '\t')
  185.             ++execstr;
  186.  
  187.         if (tmp[1] == 'f' && tmp[2] == 'o') {
  188.             force = TRUE;
  189.             goto do001;
  190.  
  191.         } else if (tmp[1] == 'i' && tmp[2] == 'f') {
  192.  
  193.             /* IF directive */
  194.             /* grab the value of the logical exp */
  195.             if (execlevel == 0) {
  196.                 if ((status = macarg(token)) != TRUE) {
  197.                     execstr = oldestr;
  198.                     return(status);
  199.                 }
  200.                 status = stol(token);
  201.             } else
  202.                 status = TRUE;
  203.  
  204.             if (status) {
  205.  
  206.                 /* IF (TRUE) */
  207.                 if (execlevel != 0)
  208.                     ++execlevel;
  209.             } else {
  210.  
  211.                 /* IF (FALSE) */
  212.                 ++execlevel;
  213.             }
  214.  
  215.         } else if (tmp[1] == 'e' && tmp[2] == 'l') {
  216.  
  217.             /* ELSE directive */
  218.             if (execlevel == 1)
  219.                 --execlevel;
  220.             else if (execlevel == 0 )
  221.                 ++execlevel;
  222.  
  223.         } else if (tmp[1] == 'e' && tmp[2] == 'n') {
  224.  
  225.             /* ENDIF directive */
  226.             if (execlevel)
  227.                 --execlevel;
  228.  
  229.         } else if (tmp[1] == 'r' && tmp[2] == 'e') {
  230.  
  231.             /* RETURN directive */
  232.             execstr = oldestr;
  233.             if (execlevel)
  234.                 return(TRUE);
  235.             else
  236.                 return(RET);
  237.  
  238.         } else if (tmp[1] == 'g' && tmp[2] == 'o') {
  239.  
  240.             /* GOTO directive */
  241.             /* .....only if we are currently executing */
  242.             if (execlevel) {
  243.                 execstr = oldestr;
  244.                 return(TRUE);
  245.             }
  246.  
  247.             while (*execstr == ' ' || *execstr == '\t')
  248.                 ++execstr;
  249.             strncpy(golabel, execstr, NPAT - 1);
  250.             return(GOLINE);
  251.  
  252.         } else {
  253.             mlwrite("%%Unknown Directive");
  254.             return(FALSE);
  255.         }
  256.  
  257.         /* restore execstr and exit */
  258.         execstr = oldestr;
  259.         return(TRUE);
  260.     }
  261.  
  262. do001:    /* if we are scanning and not executing..go back here */
  263.     if (execlevel) {
  264.         execstr = oldestr;
  265.         return(TRUE);
  266.     }
  267.  
  268.     /* first set up the default command values */
  269.     f = FALSE;
  270.     n = 1;
  271.     lastflag = thisflag;
  272.     thisflag = 0;
  273.  
  274.     if ((status = macarg(token)) != TRUE) {    /* and grab the first token */
  275.         execstr = oldestr;
  276.         return(status);
  277.     }
  278.  
  279.     /* process leadin argument */
  280.     if (gettyp(token) != TKCMD) {
  281.         f = TRUE;
  282.         n = atoi(getval(token));
  283.  
  284.         /* and now get the command to execute */
  285.         if ((status = macarg(token)) != TRUE) {
  286.             execstr = oldestr;
  287.             return(status);    
  288.         }    
  289.     }
  290.  
  291.     /* and match the token to see if it exists */
  292.     if ((fnc = fncmatch(token)) == NULL) {
  293.         mlwrite("[No such Function]");
  294.         execstr = oldestr;
  295.         return(FALSE);
  296.     }
  297.     
  298.     /* save the arguments and go execute the command */
  299.     oldcle = clexec;        /* save old clexec flag */
  300.     clexec = TRUE;            /* in cline execution */
  301.     status = (*fnc)(f, n);        /* call the function */
  302.     cmdstatus = status;        /* save the status */
  303.     if (force)            /* force the status */
  304.         status = TRUE;
  305.     clexec = oldcle;        /* restore clexec flag */
  306.     execstr = oldestr;
  307.     return(status);
  308. }
  309.  
  310. /* token:    chop a token off a string
  311.         return a pointer past the token
  312. */
  313.  
  314. char *token(src, tok)
  315.  
  316. char *src, *tok;    /* source string, destination token string */
  317.  
  318. {
  319.     register int quotef;    /* is the current string quoted? */
  320.  
  321.     /* first scan past any whitespace in the source string */
  322.     while (*src == ' ' || *src == '\t')
  323.         ++src;
  324.  
  325.     /* scan through the source string */
  326.     quotef = FALSE;
  327.     while (*src) {
  328.         /* process special characters */
  329.         if (*src == '~') {
  330.             ++src;
  331.             if (*src == 0)
  332.                 break;
  333.             switch (*src++) {
  334.                 case 'r':    *tok++ = 13; break;
  335.                 case 'n':    *tok++ = 10; break;
  336.                 case 't':    *tok++ = 9;  break;
  337.                 case 'b':    *tok++ = 8;  break;
  338.                 case 'f':    *tok++ = 12; break;
  339.                 default:    *tok++ = *(src-1);
  340.             }
  341.         } else {
  342.             /* check for the end of the token */
  343.             if (quotef) {
  344.                 if (*src == '"')
  345.                     break;
  346.             } else {
  347.                 if (*src == ' ' || *src == '\t')
  348.                     break;
  349.             }
  350.  
  351.             /* set quote mode if qoute found */
  352.             if (*src == '"')
  353.                 quotef = TRUE;
  354.  
  355.             /* record the character */
  356.             *tok++ = *src++;
  357.         }
  358.     }
  359.  
  360.     /* terminate the token and exit */
  361.     if (*src)
  362.         ++src;
  363.     *tok = 0;
  364.     return(src);
  365. }
  366.  
  367. macarg(tok)    /* get a macro line argument */
  368.  
  369. char *tok;    /* buffer to place argument */
  370.  
  371. {
  372.     int savcle;    /* buffer to store original clexec */
  373.     int status;
  374.  
  375.     savcle = clexec;    /* save execution mode */
  376.     clexec = TRUE;        /* get the argument */
  377.     status = nextarg("", tok, NSTRING, ctoec('\n'));
  378.     clexec = savcle;    /* restore execution mode */
  379.     return(status);
  380. }
  381.  
  382. /*    nextarg:    get the next argument    */
  383.  
  384. nextarg(prompt, buffer, size, terminator)
  385.  
  386. char *prompt;        /* prompt to use if we must be interactive */
  387. char *buffer;        /* buffer to put token into */
  388. char *size;        /* size of the buffer */
  389. int terminator;        /* terminating char to be used on interactive fetch */
  390.  
  391. {
  392.     /* if we are interactive, go get it! */
  393.     if (clexec == FALSE)
  394.         return(getstring(prompt, buffer, size, terminator));
  395.  
  396.     /* grab token and advance past */
  397.     execstr = token(execstr, buffer);
  398.  
  399.     /* evaluate it */
  400.     strcpy(buffer, getval(buffer));
  401.     return(TRUE);
  402. }
  403.  
  404. /*    storemac:    Set up a macro buffer and flag to store all
  405.             executed command lines there            */
  406.  
  407. storemac(f, n)
  408.  
  409. int f;        /* default flag */
  410. int n;        /* macro number to use */
  411.  
  412. {
  413.     register struct BUFFER *bp;    /* pointer to macro buffer */
  414.     char bname[NBUFN];        /* name of buffer to use */
  415.  
  416.     /* must have a numeric argument to this function */
  417.     if (f == FALSE) {
  418.         mlwrite("No macro specified");
  419.         return(FALSE);
  420.     }
  421.  
  422.     /* range check the macro number */
  423.     if (n < 1 || n > 40) {
  424.         mlwrite("Macro number out of range");
  425.         return(FALSE);
  426.     }
  427.  
  428.     /* construct the macro buffer name */
  429.     strcpy(bname, "[Macro xx]");
  430.     bname[7] = '0' + (n / 10);
  431.     bname[8] = '0' + (n % 10);
  432.  
  433.     /* set up the new macro buffer */
  434.     if ((bp = bfind(bname, TRUE, BFINVS)) == NULL) {
  435.         mlwrite("Can not create macro");
  436.         return(FALSE);
  437.     }
  438.  
  439.     /* and make sure it is empty */
  440.     bclear(bp);
  441.  
  442.     /* and set the macro store pointers to it */
  443.     mstore = TRUE;
  444.     bstore = bp;
  445.     return(TRUE);
  446. }
  447.  
  448. /*    execbuf:    Execute the contents of a buffer of commands    */
  449.  
  450. execbuf(f, n)
  451.  
  452. int f, n;    /* default flag and numeric arg */
  453.  
  454. {
  455.         register BUFFER *bp;        /* ptr to buffer to execute */
  456.         register int status;        /* status return */
  457.         char bufn[NBUFN];        /* name of buffer to execute */
  458.  
  459.     /* find out what buffer the user wants to execute */
  460.         if ((status = mlreply("Execute buffer: ", bufn, NBUFN)) != TRUE)
  461.                 return(status);
  462.  
  463.     /* find the pointer to that buffer */
  464.         if ((bp=bfind(bufn, FALSE, 0)) == NULL) {
  465.         mlwrite("No such buffer");
  466.                 return(FALSE);
  467.         }
  468.  
  469.     /* and now execute it as asked */
  470.     while (n-- > 0)
  471.         if ((status = dobuf(bp)) != TRUE)
  472.             return(status);
  473.     return(TRUE);
  474. }
  475.  
  476. /*    dobuf:    execute the contents of the buffer pointed to
  477.         by the passed BP                */
  478.  
  479. dobuf(bp)
  480.  
  481. BUFFER *bp;    /* buffer to execute */
  482.  
  483. {
  484.         register int status;        /* status return */
  485.     register LINE *lp;        /* pointer to line to execute */
  486.     register LINE *hlp;        /* pointer to line header */
  487.     register LINE *glp;        /* line to goto */
  488.     register int linlen;        /* length of line to execute */
  489.     register WINDOW *wp;        /* ptr to windows to scan */
  490.     char *eline;            /* text of line to execute */
  491.  
  492.     /* clear IF level flags */
  493.     execlevel = 0;
  494.  
  495.     /* starting at the beginning of the buffer */
  496.     hlp = bp->b_linep;
  497.     lp = hlp->l_fp;
  498.     while (lp != hlp) {
  499.         /* allocate eline and copy macro line to it */
  500.         linlen = lp->l_used;
  501.         if ((eline = malloc(linlen+1)) == NULL) {
  502.             mlwrite("%%Out of Memory during macro execution");
  503.             return(FALSE);
  504.         }
  505.         strncpy(eline, lp->l_text, linlen);
  506.         eline[linlen] = 0;    /* make sure it ends */
  507.  
  508.         /* trim leading whitespace */
  509.         while (eline[0] == ' ' || eline[0] == '\t')
  510.             strcpy(eline, &eline[1]);
  511.  
  512.         /* if it is not a comment, execute it */
  513.         if (eline[0] != 0 && eline[0] != ';') {
  514.             status = docmd(eline);
  515.  
  516.             /* if it is a !GOTO directive, deal with it */
  517.             if (status == GOLINE) {
  518.                 linlen = strlen(golabel);
  519.                 glp = hlp->l_fp;
  520.                 while (glp != hlp) {
  521.                     if (*glp->l_text == '*' &&
  522.                         (strncmp(&glp->l_text[1], golabel,
  523.                                 linlen) == 0)) {
  524.                         lp = glp;
  525.                         status = TRUE;
  526.                     }
  527.                 glp = glp->l_fp;
  528.                 }
  529.             }
  530.  
  531.             if (status == GOLINE) {
  532.                 mlwrite("%%No such label");
  533.                 return(FALSE);
  534.             }
  535.  
  536.             /* if it is a !RETURN directive...do so */
  537.             if (status == RET) {
  538.                 free(eline);
  539.                 break;
  540.             }
  541.  
  542.             /* check for a command error */
  543.             if (status != TRUE) {
  544.                 /* look if buffer is showing */
  545.                 wp = wheadp;
  546.                 while (wp != NULL) {
  547.                     if (wp->w_bufp == bp) {
  548.                         /* and point it */
  549.                         wp->w_dotp = lp;
  550.                         wp->w_doto = 0;
  551.                         wp->w_flag |= WFHARD;
  552.                     }
  553.                     wp = wp->w_wndp;
  554.                 }
  555.                 /* in any case set the buffer . */
  556.                 bp->b_dotp = lp;
  557.                 bp->b_doto = 0;
  558.                 free(eline);
  559.                 execlevel = 0;
  560.                 return(status);
  561.             }
  562.         }
  563.  
  564.         /* on to the next line */
  565.         free(eline);
  566.         lp = lp->l_fp;
  567.     }
  568.  
  569.     /* exit the current function */
  570.     execlevel = 0;
  571.         return(TRUE);
  572. }
  573.  
  574. execfile(f, n)    /* execute a series of commands in a file
  575. */
  576.  
  577. int f, n;    /* default flag and numeric arg to pass on to file */
  578.  
  579. {
  580.     register int status;    /* return status of name query */
  581.     char *fname[NSTRING];    /* name of file to execute */
  582.  
  583.     if ((status = mlreply("File to execute: ", fname, NSTRING -1)) != TRUE)
  584.         return(status);
  585.  
  586.     /* otherwise, execute it */
  587.     while (n-- > 0)
  588.         if ((status=dofile(fname)) != TRUE)
  589.             return(status);
  590.  
  591.     return(TRUE);
  592. }
  593.  
  594. /*    dofile:    yank a file into a buffer and execute it
  595.         if there are no errors, delete the buffer on exit */
  596.  
  597. dofile(fname)
  598.  
  599. char *fname;    /* file name to execute */
  600.  
  601. {
  602.     register BUFFER *bp;    /* buffer to place file to exeute */
  603.     register BUFFER *cb;    /* temp to hold current buf while we read */
  604.     register int status;    /* results of various calls */
  605.     char bname[NBUFN];    /* name of buffer */
  606.  
  607.     makename(bname, fname);        /* derive the name of the buffer */
  608.     if ((bp = bfind(bname, TRUE, 0)) == NULL) /* get the needed buffer */
  609.         return(FALSE);
  610.  
  611.     bp->b_mode = MDVIEW;    /* mark the buffer as read only */
  612.     cb = curbp;        /* save the old buffer */
  613.     curbp = bp;        /* make this one current */
  614.     /* and try to read in the file to execute */
  615.     if ((status = readin(fname, FALSE)) != TRUE) {
  616.         curbp = cb;    /* restore the current buffer */
  617.         return(status);
  618.     }
  619.  
  620.     /* go execute it! */
  621.     curbp = cb;        /* restore the current buffer */
  622.     if ((status = dobuf(bp)) != TRUE)
  623.         return(status);
  624.  
  625.     /* if not displayed, remove the now unneeded buffer and exit */
  626.     if (bp->b_nwnd == 0)
  627.         zotbuf(bp);
  628.     return(TRUE);
  629. }
  630.  
  631. /*    cbuf:    Execute the contents of a numbered buffer    */
  632.  
  633. cbuf(f, n, bufnum)
  634.  
  635. int f, n;    /* default flag and numeric arg */
  636. int bufnum;    /* number of buffer to execute */
  637.  
  638. {
  639.         register BUFFER *bp;        /* ptr to buffer to execute */
  640.         register int status;        /* status return */
  641.     static char bufname[] = "[Macro xx]";
  642.  
  643.     /* make the buffer name */
  644.     bufname[7] = '0' + (bufnum / 10);
  645.     bufname[8] = '0' + (bufnum % 10);
  646.  
  647.     /* find the pointer to that buffer */
  648.         if ((bp=bfind(bufname, FALSE, 0)) == NULL) {
  649.             mlwrite("Macro not defined");
  650.                 return(FALSE);
  651.         }
  652.  
  653.     /* and now execute it as asked */
  654.     while (n-- > 0)
  655.         if ((status = dobuf(bp)) != TRUE)
  656.             return(status);
  657.     return(TRUE);
  658. }
  659.  
  660. cbuf1(f, n)
  661.  
  662. {
  663.     cbuf(f, n, 1);
  664. }
  665.  
  666. cbuf2(f, n)
  667.  
  668. {
  669.     cbuf(f, n, 2);
  670. }
  671.  
  672. cbuf3(f, n)
  673.  
  674. {
  675.     cbuf(f, n, 3);
  676. }
  677.  
  678. cbuf4(f, n)
  679.  
  680. {
  681.     cbuf(f, n, 4);
  682. }
  683.  
  684. cbuf5(f, n)
  685.  
  686. {
  687.     cbuf(f, n, 5);
  688. }
  689.  
  690. cbuf6(f, n)
  691.  
  692. {
  693.     cbuf(f, n, 6);
  694. }
  695.  
  696. cbuf7(f, n)
  697.  
  698. {
  699.     cbuf(f, n, 7);
  700. }
  701.  
  702. cbuf8(f, n)
  703.  
  704. {
  705.     cbuf(f, n, 8);
  706. }
  707.  
  708. cbuf9(f, n)
  709.  
  710. {
  711.     cbuf(f, n, 9);
  712. }
  713.  
  714. cbuf10(f, n)
  715.  
  716. {
  717.     cbuf(f, n, 10);
  718. }
  719.  
  720. cbuf11(f, n)
  721.  
  722. {
  723.     cbuf(f, n, 11);
  724. }
  725.  
  726. cbuf12(f, n)
  727.  
  728. {
  729.     cbuf(f, n, 12);
  730. }
  731.  
  732. cbuf13(f, n)
  733.  
  734. {
  735.     cbuf(f, n, 13);
  736. }
  737.  
  738. cbuf14(f, n)
  739.  
  740. {
  741.     cbuf(f, n, 14);
  742. }
  743.  
  744. cbuf15(f, n)
  745.  
  746. {
  747.     cbuf(f, n, 15);
  748. }
  749.  
  750. cbuf16(f, n)
  751.  
  752. {
  753.     cbuf(f, n, 16);
  754. }
  755.  
  756. cbuf17(f, n)
  757.  
  758. {
  759.     cbuf(f, n, 17);
  760. }
  761.  
  762. cbuf18(f, n)
  763.  
  764. {
  765.     cbuf(f, n, 18);
  766. }
  767.  
  768. cbuf19(f, n)
  769.  
  770. {
  771.     cbuf(f, n, 19);
  772. }
  773.  
  774. cbuf20(f, n)
  775.  
  776. {
  777.     cbuf(f, n, 20);
  778. }
  779.  
  780. cbuf21(f, n)
  781.  
  782. {
  783.     cbuf(f, n, 21);
  784. }
  785.  
  786. cbuf22(f, n)
  787.  
  788. {
  789.     cbuf(f, n, 22);
  790. }
  791.  
  792. cbuf23(f, n)
  793.  
  794. {
  795.     cbuf(f, n, 23);
  796. }
  797.  
  798. cbuf24(f, n)
  799.  
  800. {
  801.     cbuf(f, n, 24);
  802. }
  803.  
  804. cbuf25(f, n)
  805.  
  806. {
  807.     cbuf(f, n, 25);
  808. }
  809.  
  810. cbuf26(f, n)
  811.  
  812. {
  813.     cbuf(f, n, 26);
  814. }
  815.  
  816. cbuf27(f, n)
  817.  
  818. {
  819.     cbuf(f, n, 27);
  820. }
  821.  
  822. cbuf28(f, n)
  823.  
  824. {
  825.     cbuf(f, n, 28);
  826. }
  827.  
  828. cbuf29(f, n)
  829.  
  830. {
  831.     cbuf(f, n, 29);
  832. }
  833.  
  834. cbuf30(f, n)
  835.  
  836. {
  837.     cbuf(f, n, 30);
  838. }
  839.  
  840. cbuf31(f, n)
  841.  
  842. {
  843.     cbuf(f, n, 31);
  844. }
  845.  
  846. cbuf32(f, n)
  847.  
  848. {
  849.     cbuf(f, n, 32);
  850. }
  851.  
  852. cbuf33(f, n)
  853.  
  854. {
  855.     cbuf(f, n, 33);
  856. }
  857.  
  858. cbuf34(f, n)
  859.  
  860. {
  861.     cbuf(f, n, 34);
  862. }
  863.  
  864. cbuf35(f, n)
  865.  
  866. {
  867.     cbuf(f, n, 35);
  868. }
  869.  
  870. cbuf36(f, n)
  871.  
  872. {
  873.     cbuf(f, n, 36);
  874. }
  875.  
  876. cbuf37(f, n)
  877.  
  878. {
  879.     cbuf(f, n, 37);
  880. }
  881.  
  882. cbuf38(f, n)
  883.  
  884. {
  885.     cbuf(f, n, 38);
  886. }
  887.  
  888. cbuf39(f, n)
  889.  
  890. {
  891.     cbuf(f, n, 39);
  892. }
  893.  
  894. cbuf40(f, n)
  895.  
  896. {
  897.     cbuf(f, n, 40);
  898. }
  899.  
  900.  
  901.